import './App.css';
import { Routes, Route, Link } from "react-router-dom"
function App() {
  return (
    <div className="App">
      <header className="App-header">
        <Routes>
          <Route path="/list" element={<List />}></Route>
          <Route path="/detail" element={<Detail />}></Route>
        </Routes>
      </header>
    </div>
  );
}
function List() {
   const goDetilPage = () => {
    const h5Manager = window.tt.miniProgram.createMessageManager()
    
    h5Manager.transferMessage({
      data: {
        type: 'OPEN_DETAIL',
      },
      success: res => {
        console.log(res)
      },
      fail: res => {
        console.log(res)
      }
    })
  }
  return <div>
    <main>
      <h2>Welcome to the List Page</h2>
    </main>
    <nav>
      <button onClick={goDetilPage}>detail page</button>
    </nav>
  </div>
}
function Detail() {
  return <div>
    <main>
      <h2>Welcome to the Detail Page</h2>
    </main>
   <div>
   Detail Page
   </div>
  </div>
}
export default App;
